<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl">
  <head>
    <link rel="stylesheet" type="text/css" href="sfp.css" />

    <script type="text/javascript" src="external.js"></script>
    <script type="text/javascript" src="home.js"></script>

    <title>SAX Delphi XML Pascal</title>
    <meta name="Author" content="Sax for Pascal @ SourceForge.net" />
    <meta name="Keywords" content="SAX,Delphi,XML,Pascal" />
    <meta name="Description" content="SAX for Pascal is the Delphi port of the Simple API for XML Parsing interfaces." />
    <meta name="robots" content="index,follow" />
  </head>
  <body>
    <script type="text/javascript">
      <!--
      // If not loaded in frames, load the frames
      if (window.name == "") {
        location.reload ("index.html?faq.html")
      }
      // -->
    </script>
    <h1>Frequently Asked Questions</h1>
    
    
    <h4><a name="missing_package">
      Why is Delphi complaining about missing packages after installing 
      <b class="name">SAX for Pascal</b>?
    </a></h4>
    <p>
      When Delphi compiles a package, it turns it into a special kind of <a rel="external"
      href="http://info.borland.com/techpubs/delphi/delphi5/oplg/dllpackg.html#6459">DLL</a>. 
      Therefore, the same <a rel="external" 
      href="http://www.codeguru.com/dll/AppPath.shtml">rules</a> for locating DLLs apply to 
      compiled packages. So, if you put a compiled package into a directory that is on
      your <tt>PATH</tt>, Delphi should be able to load the package.
    </p>
    <p>
      A more convenient solution is provided by Delphi's <strong>library path</strong>. 
      This is similar to your system's <tt>PATH</tt> environment variable, but specific
      to Delphi. You can set this on the <tt>Library</tt> tab of the 
      <tt>Environment options</tt> dialog (select <tt>Environment options...</tt> from the 
      <tt>Tools</tt> menu).
    </p>
    
    
    <h4><a name="question_mark">
      Why do I sometimes see question marks or strange looking characters when displaying the data 
      reported by a SAX parser?
    </a></h4>
    <p>
      XML is based on <a rel="external" href="http://www.unicode.org">Unicode</a>, that is, XML 
      documents can contain over a million different <a rel="external" 
      href="http://www.cs.tut.fi/~jkorpela/chars.html#characters">characters</a>, for all major 
      languages in the world.
      The <a rel="external" href="http://www.ezresult.com/article/VCL">VCL</a> controls in a Delphi 
      application are only capable of displaying the characters of the current <a rel="external" 
      href="http://www.microsoft.com/globaldev/reference/WinCP.mspx">Windows codepage</a>, other 
      characters are replaced with a <a rel="external" 
      href="http://www.cs.tut.fi/~jkorpela/chars.html#display">question mark or small box</a>. However, 
      <a rel="external" href="http://www.ezresult.com/article/Component_Library_for_Cross_Platform">CLX</a> 
      controls should be capable of displaying Unicode characters. For both types of controls it is 
      obviously necessary that the chosen <a rel="external" 
			href="http://www.alanwood.net/unicode/fonts.html">font</a> implements <a rel="external"
			href="http://www.cs.tut.fi/~jkorpela/chars.html#glyph">glyphs</a> for all characters to be 
			displayed. 
    </p>
    <p>
			More information can be found in <a rel="external" 
			href="http://www.w3.org/TR/unicode-xml/">Unicode in XML and other Markup Languages</a>.
    </p>
    <p>
      Note that the <b class="name">SAX for Pascal</b> packages contain some 
      <a href="overview.html#strings">conditional defines</a> to facilitate handling different sorts
      of characters.
    </p>
    
    
    <h4><a name="long_text">
      Why are sometimes not all characters returned in the <code>OnCharacters</code> event?
    </a></h4>
    <p>
      The way that SAX handles large files usually is by chunking the data. This means that 
      you may get <strong>multiple</strong> characters callbacks for a <strong>single</strong>
      element. The trick is to buffer the character content. The easiest way to do this is to
      handle the <code>OnStartElement</code> event and do something like 
      <code>FCharBuffer := '';</code>, where <code>FCharBuffer</code> is a 
      <code>SAXString</code>. Then in the <code>OnCharacters</code> event, do 
      <code>FCharBuffer := FCharBuffer + ch;</code>. And, finally, in the 
      <code>OnEndElement</code> you can use <code>FCharBuffer</code> as you please.
    </p>
    <p>
      You may need to maintain a stack of buffers if you have to buffer elements in elements 
      with <a rel="external" href="http://www.w3.org/TR/REC-xml#sec-mixed-content">mixed 
      content</a>.
    </p>
    
    
    <p/>
    <h2>More questions...</h2>
    <p>
      More information can be found in the <a rel="external" 
      href="http://www.saxproject.org/?selected=faq">SAX FAQ</a>.
    </p>
    
    <hr />
    <div><a href="javascript:home()">Home</a></div>
    
  </body>
</html>